"""
@file: mysql.py
@author: lingdubing
@time: 2024/10/26  9:09
@desc: 这是项目的mysql数据库配置文件
@character: utf-8
"""

from sqlmodel import SQLModel, create_engine
from config import settings
from models.models import User,Machine,Record,Area,Feedback,Role,Access,Bulletion,UserRoleLink,UserBulletionLink,RoleAccessLink



engine = create_engine(f"mysql+pymysql://{settings.MYSQL_USER}:{settings.MYSQL_PASSWORD}@{settings.MYSQL_IP}:{settings.MYSQL_PORT}/{settings.MYSQL_DATABASE}")


async def register():
    SQLModel.metadata.create_all(engine)
